export interface PainterOptions {
  width: number;
  height: number;
}

export interface IPainterShadow {
  shadowOffsetX?: number;
  shadowOffsetY?: number;
  shadowColor?: string;
  shadowBlur?: number;
}

export interface IPaintElement {
  x: number;
  y: number;
  width: number;
  height: number;
  dontRecord?: boolean;
}

export interface IPaintBlock extends IPaintElement {
  bgColor: string;
  borderRadius?: number;
}

export interface IPaintBorder extends IPaintElement {
  color?: string;
  borderWidth?: number;
}

type TImageMode = "aspectFit" | "aspectFill"; // 完整显示 | 裁切填充

export interface IPaintImage extends IPaintElement {
  image: string;
  borderRadius?: number;
  imageHeight?: number; // 素材图片的真实高度
  imageWidth?: number; // 素材图片的真实宽度
  shadow?: IPainterShadow; // 阴影
  mode?: TImageMode;
}

export interface IPaintCircle extends Omit<IPaintElement, "width" | "height"> {
  size: number;
  bgColor?: string;
}

export interface IPaintText extends Omit<IPaintElement, "height" | "width"> {
  color?: string;
  text: string;
  align?: "left" | "center" | "right";
  size?: number;
  lineHeight?: number;
  baseLine?: "top" | "bottom" | "middle" | "normal";
  fontWeight?: "normal" | "bold" | "bolder" | "lighter";
  fontF?: string
}

export interface IPaintMultipleLine extends IPaintText {
  maxWidth: number;
  line: number;
}

export type TDrawElement<T> = T | ((prev: IPaintElement) => T);

export interface IClipOptions {
  x: number;
  y: number;
  width: number;
  height: number;
  borderRadius: number;
  next: () => void;
}

// 画图剪裁框
export interface ICuttingBox {
  x: number;
  y: number;
  width: number;
  height: number;
}

export interface IGetCuttingBoxParams {
  width: number;
  height: number;
  imageHeight: number; // 素材图片的真实高度
  imageWidth: number; // 素材图片的真实宽度
}
